#include <bits/stdc++.h>
using namespace std;
int shu[101];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> shu[i];
  }
  int i = 1, j = k;
  while (i <= j) {
    swap(shu[i], shu[j]);
    i++;
    j--;
  }
  for (int i = 1; i <= n; i++) {
    cout << shu[i] << " ";
  }

  return 0;
}